package com.ex.kafka.controller;

import com.ex.kafka.service.KafkaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @description 做一个kafka练习demo效果
 * @Author longdeng
 * @Date 2020/3/28 0028 0:13
 */
@Controller
@RequestMapping("/api/kafka")
public class KafkaDemoController {

    @Autowired
    private KafkaService kafkaService;

    /**
     * kafka生产者生产消息
     *
     * @return
     */
    @RequestMapping("/sendMsg")
    public String sendMsg() {
        kafkaService.sendMsg();
        return "发送消息成功";
    }

}
